package com.zsrt.java.day20161227.hb.demo01;

import org.junit.Test;

public class Demo01 {
	
	@Test
	/**
	 * 发1元红包让两个人去抢
	 */
	public void qianghongbao1(){
		
		int begin=0;
		
		while(begin<10){
			
			double a=0;
			do{
				
				a=Math.random();
				
			}while(a<=0.25||a>=0.75);
			double b=1-a;
			System.out.println("开抢1元红包...");
			System.out.println("第1个人抢到："+a+"元");
			System.out.println("第2个人抢到："+b+"元");
			begin++;
			
		}
		
	}
	 
}
